// 斜率优化 二分
// https://www.luogu.com.cn/problem/P5785
#include <algorithm>
#include <cstring>
#include <iostream>
using namespace std;
using ll = long long;
using T = int;
T rad(); // quick read
const int inf = 0x3f3f3f3f;
#define rf(i, n) for (int i = 1; i <= (n); ++i)
const int max_size = 5 + 100;
const int maxn = 5 + 3e5;

int n, s;
int t[maxn], c[maxn]; // 任务时间，费用系数
ll pret[maxn], prec[maxn];
ll dp[maxn]; // 总费用 + 对后续任务的影响的费用

/*
dp[i]
    = min(dp[j] + pret[i] * (prec[i] - prec[j]) + s * (prec[n] - prec[j]))
    = min(dp[j] + pret[i] * prec[i] - pret[i] * prec[j] + s * prec[n] - s * prec[j])
    = min(dp[j] - s * prec[j] - pret[i] * prec[j] + pret[i] * prec[i] + s * prec[n])
    = A(i) + min(Y(j) - K(i) * X(j)),
        A(i) = pret[i] * prec[i] + s * prec[n]
        Y(j) = dp[j] - s * prec[j]
        K(i) = pret[i]
        X(j) = prec[j]

*/
inline ll A(int i) { return pret[i] * prec[i] + s * prec[n]; }
inline ll Y(int j) { return dp[j]; }
inline ll K(int i) { return pret[i] + s; }
inline ll X(int j) { return prec[j]; }

int qe[maxn], head, tail;

bool check(int p1, int p2, int p3) { // return k12 >= k23
    ll x1 = X(p1), y1 = Y(p1), x2 = X(p2), y2 = Y(p2), x3 = X(p3), y3 = Y(p3);
    return (y2 - y1) * (x3 - x2) >= (y3 - y2) * (x2 - x1);
}

inline void insert(int pos) {
    while (tail - head >= 2 && check(qe[tail - 2], qe[tail - 1], pos))
        tail--;
    qe[tail++] = pos;
}

// inline void maintain(int pos) {
//     ll k = K(pos);
//     while (tail - head >= 2 && !check(qe[head], qe[head + 1], k))
//         head++;
// }

bool check(int i, ll k) { // return k12 > k
    ll x1 = X(qe[i]), y1 = Y(qe[i]), x2 = X(qe[i + 1]), y2 = Y(qe[i + 1]);
    return y2 - y1 > k * (x2 - x1);
}

int binser(int pos) {
    if (tail - head <= 1) return head;
    ll k = K(pos);
    int l = 0, r = tail - 1;
    if (!check(r - 1, k)) return r;
    while (l < r) {
        int mid = l + r >> 1;
        if (check(mid, k))
            r = mid;
        else
            l = mid + 1;
    }
    return r;
}

int main() {
    // freopen("main.in", "r", stdin);
    n = rad(), s = rad();
    rf(i, n) t[i] = rad(), c[i] = rad(), pret[i] = t[i] + pret[i - 1], prec[i] = c[i] + prec[i - 1];

    qe[tail++] = 0;
    for (int i = 1; i <= n; ++i) {
        // maintain(i);
        int j = qe[binser(i)];
        // int j = qe[head];
        dp[i] = Y(j) - K(i) * X(j) + A(i);
        insert(i);
    }
    printf("%lld\n", dp[n]);
}

T rad() {
    T back = 0;
    int ch = 0, posi = 0;
    for (; ch < '0' || ch > '9'; ch = getchar())
        posi = ch ^ '-';
    for (; ch >= '0' && ch <= '9'; ch = getchar())
        back = (back << 1) + (back << 3) + (ch & 0xf);
    return posi ? back : -back;
}